// graphql
const { graphql, buildSchema } = require('graphql')

// 创建一个schema
const helloSchema = buildSchema(`
  type Query {
    hello: String
  }
`)

const data = {
  hello: () => 'Hello world'
}

// 异步api
graphql(helloSchema, '{ hello }', data).then(rst => {
  console.log(rst)
})